﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Text.RegularExpressions;

namespace Mathematics.Parser
{
    public class TokenDefinition
    {
        internal TokenDefinition(TokenType type,string symbol)
        {
            Type = type;
            //Name = name;
            TokenSymbol = symbol;
            //Category = category;
            Expression = new Regex(symbol);
        }

        //public string Name { get; private set; }
        public string TokenSymbol { get; private set; }
        //public TokenCategory Category{ get; private set; }
        public TokenType Type { get; private set; }
        public Regex Expression { get; private set; }

        public bool IsMatch(string input)
        {
            return Expression.IsMatch(input);
        }
        
    }
}
